import request from '@/utils/request'

/**
 * @description 获取二级导航
 * @param {*}
 * @return {*}
 */
export const getCategoryAPI = (id) => {
  return request.get('/category', {
    params: {
       id
    }
  })
}

/**
 * @description 获取二级分类列表数据
 * @param {*}
 * @return {*}
 */
export const getCategoryFilterAPI = (id) => {
  return request.get('/category/sub/filter', {
    params: {
      id
    }
  })
}

/**
 * @description 获取导航数据
 * @data {
 *  categoryId: 1005000,
 *  page: 1,
 *  pageSize: 20,
 *  sortField: 'publishTime' | 'orderNum', 'evaluateNum'
 * }
 * @return {*}
 */
export const getSubCategoryAPI = (data) => {
  return request.post('/category/goods/temporary', data)
}
